package org.kisekiproject.course {

	/**
	 * An include file.
	 */
	public class CourseInclude {

		private var _src:String;
		private var _tag:XML;

		/**
		 * Constructor.
		 */
		public function CourseInclude(tag:XML) {
			_src=tag.@src;
			_tag=tag;
		}

		/**
		 * Get src.
		 */
		public function get src():String {
			return _src;
		}

		/**
		 * Set replacement xml.
		 */
		public function processXml(value:XML):void {
			var parent:XML=_tag.parent();

			for each (var x:XML in value.children())
				parent.insertChildBefore(_tag,x);

//			trace("child index: "+_tag.childIndex());
//			delete parent[_tag.childIndex()];
		}

		/**
		 * Get tag.
		 */
		public function get tag():XML {
			return _tag;
		}
	}
}